<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$(".maincategory").click(function() {
		$("ul").slideDown("slow");
	});
});
</script>

<style type="text/css">
ul
{
display:none;
}
</style>

<?php echo Form::open('admin/promotions/save')?>
<?php foreach($categories as $root_category): ?>
<div class="maincategory">
	<?php echo Form::checkbox('category'.$root_category->id);?>	
	<?php echo Form::label('category'.$root_category->id, $root_category->name);?>
</div>
<div class="subcategory">
	<ul>
	<?php foreach($root_category->subcategories->find_all() as $subcategory):?>
		<li>
		<?php echo Form::checkbox('category'.$subcategory->id);?>	
		<?php echo Form::label('category'.$subcategory->id, $subcategory->name);?>
		</li>
	<?php endforeach;?>
	</ul>
</div>
<?php endforeach;?>
<?php echo Form::close();?>
<?php ?>